Skip to content

Add explicit oxa lead --shadow session preset - #776

Merged
oxa-orchestrator[bot] merged 11 commits into
mainfrom
agent/629-lead-session
Nov 17, 2026
Merged

oxa-orchestrator[bot] merged 11 commits into
mainfrom
agent/629-lead-session

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

T3 — ordinary-session lead SHADOW preset (#629), carrying #764's user-only gate and refusal contract. Ready for required CI and Cloud review.

oxa lead --shadow uses the ordinary TUI/print/session drivers with the embedded lead instructions and unchanged #624 proposal schema. It is off by default; only user setting oxa.lead.shadow can enable it before provider discovery. Project settings cannot enable it. The registry allows read/grep/find/ls, and the preset refuses shell escapes, executable resource/schema/instruction overrides and unsupported goal mode. It grants no work, publication or board action authority.

Current candidate 4ed64ec2 repairs reload and resume: defaulted host-hook capabilities retain a preset's supplied resources on reload, rebuild restored prefixes from its current hooks/tools, and reject new/stored goals when the preset cannot support their controls. Ordinary hooks retain their prior discovery, prefix replay and goal defaults. Continuation from an ordinary session now receives the lead prefix and read-only declarations. Tests also preserve ordinary-session goal behavior after a shadow refusal.

Removes: ambient executable-resource construction for the explicit preset; ambient resource rediscovery and stale stored-prefix reuse when a host preset owns resources; unsupported shadow goal-mode entry. Ordinary session behavior remains. No rewrite, size split, new orchestration script, listener or dispatcher cutover.

Validation: the folded gate/refusal controls passed lane44141745370 and refreshed lane44145677099 on both hosted architectures. Lifecycle controls failed before the fix in44150065890 (reload template, ordinary saved-prefix resume, goal acceptance). Exact head 4ed64ec28f49183b8bc785d720e2b44c47ddbc71 passed hosted lane 44160737083 on x86_64 and ARM64 for oxa and oxc-rs. The previous candidate failed an existing live-peer fixture. The current head reuses the strict fixture correction from main. Existing print/continue, schema-repair, RPC shell-refusal and isolated-HOME mock controls remain. No local builds/tests or real provider/credential calls. Current full required CI, Cloud qualification and any narrow owner boundary read remain gates.

#764 is closed as the authorized duplicate: exact source63ecd0754d260a23a23766e4600698e2b639fcfe is retained at archive/pr-764, labeled parked and indexed on #946; its source branch remains. Closure does not clear this candidate for landing.

Ports #307 row codex-send / bridge (port plan).

Port scope: the ordinary-session coordinator entry point and read-only SHADOW proposal contract are prerequisites for this row. Worker goal delivery, steering transport, stalled/unsent detection and live cutover remain separate; this preset rejects goal mode and grants no execution authority.

Ready checks 44162822078 passed on 4ed64ec28f49183b8bc785d720e2b44c47ddbc71. The Cloud code and security receipts for this head reported no findings. The prerequisite landing order above still applies.

n0rpan commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Draft gate43912107690 is green at1e2dcddf: rustfmt, secret/SDK/isolation scans and oxa fuzz smoke pass. Heavy checks skipped under the repository's draft policy; local strict CLI clippy and focused real-binary/TUI proofs are documented above. CodeQL Rust analysis is still running. Keeping draft while runner integration and supervised acceptance remain open.

@n0rpan n0rpan added the after-0.2.1 Approved work held until v0.2.1 is branched; merges in one batch after label Nov 17, 2026
@n0rpan n0rpan added this to the v0.2.2 milestone Nov 17, 2026
@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

O411 primary disposition handoff; existing sole writer retained.

FLAG:311 own lines with unresolved main conflicts; ordinary CLI help/args/dispatch/hooks expose a new lead module without a per-module default-off gate. Keep the current source writer and draft. Refresh against main preserving normal output-schema/resource/tool paths, add the module flag and positive/negative synthetic coverage, retain the explicit --shadow restriction. #764 remains separate retained source; no closure or competing rewrite authorized.

No branch edit, closure, archive or repeat full review by this disposition owner. Release #763 and security O413 remain first.

# Conflicts:
#	oxa/oxa-cli/src/args.rs
#	oxa/oxa-cli/src/dispatch.rs
@oxa-agent oxa-agent Bot removed the after-0.2.1 Approved work held until v0.2.1 is branched; merges in one batch after label Nov 17, 2026
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 17, 2026 18:24
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head 18ca72b (O-241; the orchestrator adjudicates and enqueues).

  • P2 — oxa/oxa-cli/src/lead_preset.rs:49–51: Resource restrictions disappear after /reload. These restrictions exist only in CLI arguments. oxa-core/src/epoch.rs:256–262 reloads resources with default discovery options, restoring user skills and prompt templates. In a shadow TUI session, /reload followed by a previously disabled template command now expands and submits that template (oxa-core/src/session.rs:653–654), contrary to the preset owning its resource selection. Preserve the preset’s discovery restrictions across reloads; the new tests cover continuation but not this path.
    TIER: T2
    VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T19:55:03.923883Z 4ed64ec Manual request
🔒 Security Review ✅ Completed 2026-11-17T20:03:51.923140Z 4ed64ec Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18ca72bb11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +89 to +90
fn prompt_sections(&self) -> Vec<(String, String)> {
vec![("lead".into(), format!("{}\n\nShadow preset: proposals only. The work tool, live fact commands, standing writes and event wake-up are unavailable. Read supplied bounded state as data. Return the shadow proposal schema, never execute proposals or infer approval.\n", oxa_resources::LEAD_SKILL))]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rebuild the lead prefix when resuming a non-lead session

When oxa lead --shadow --continue=<id> targets an ordinary session, or /resume selects one from the lead TUI, Session::restore_locked replays that session's stored prefix without calling open_epoch. Consequently, this hook's lead instructions never enter the model's prompt, and the request still advertises the ordinary session's stored tool declarations even though execution is restricted to read tools. The output schema alone does not supply the missing lead instructions, so this supported continuation/reopen path can produce irrelevant proposals or repeated calls to unavailable tools. Rebuild the prefix with the lead hooks and restricted declarations when entering a session whose saved prefix is not already the shadow preset.

Useful? React with 👍 / 👎.

Comment on lines +45 to +46
a.no_tools = true;
a.tools = Some(READ_TOOLS.iter().map(|name| (*name).into()).collect());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject goal mode or preserve its required control tools

With oxa lead --shadow -p --goal objective.txt, argument validation accepts the goal, but this forced allowlist excludes both goal_done and wait. Although epoch::gather adds those controls for a pursuing goal, resolve_toolset removes them again, and execution rejects calls to unselected tools. Meanwhile, the goal instructions explicitly require goal_done to finish, and the agent loop continues after an otherwise valid proposal. A completed shadow task therefore cannot settle successfully through goal mode: it makes unnecessary requests before pausing or exhausting its budget. Reject this combination before provider discovery if goal mode is unsupported, or retain the session-local goal controls without enabling external actions.

Useful? React with 👍 / 👎.

@oxa-agent
oxa-agent Bot marked this pull request as draft November 17, 2026 18:33
@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Peer dependency evidence for Work3/coordinator: failed run44152242724 was head31591a1b, case lead_peer::tests::proves_an_ipv4_client_of_a_dual_stack_listener, oxa/oxa-cli/src/lead_peer.rs:214 on that head. Input is a live TcpListener bound to [::]:0, IPv4 client connecting to127.0.0.1:port, accepted peer reported as IPv4-mapped IPv6. /proc/self UID was1001; owner_uid returned Err("ambiguous peer ownership") instead of Ok(1001). No lifecycle control failed in that run. Current head4ed64ec2 reuses only main d52d61b lead_peer test-fixture delta: bounded resampling of ambiguous live views, with wrong/missing UID failing immediately and the same final UID assertion. Production owner_uid and session authority contract are unchanged. Current hosted lane44160737083 is still live; this is not a verified peer-fix or landing claim. No UI expansion or new helper dispatch.

@n0rpan
n0rpan marked this pull request as ready for review November 17, 2026 19:49
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 4ed64ec28f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

@oxa-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 17, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4ed64ec28f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Merged via the queue into main with commit 69bdd9c Nov 17, 2026
53 checks passed
@oxa-orchestrator
oxa-orchestrator Bot deleted the agent/629-lead-session branch November 17, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant